home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / Blitz2 / BlitzFaq / FaqLists / WindowPattern.txt < prev   
Encoding:
Text File  |  1996-09-05  |  1.2 KB  |  53 lines

  1. ; Standard Initialization
  2. DEFTYPE .w
  3. WBStartup
  4. NoCli
  5. WbToScreen 0
  6. ShowScreen 0
  7.  
  8. ; The bitmap with the pattern.
  9. #PATTERN=0
  10.  
  11. ; Setup
  12. BorderPens 2,1
  13. ExScreenObj 0
  14. BitMap #PATTERN,64,32,3
  15. Circlef 32,16,30,15,3
  16. Circlef 32,16,15,7,0
  17. patwidth=64
  18. patheight=32
  19.  
  20. Statement Putpattern {w,close,bor}
  21. SHARED patwidth,patheight
  22. Use Window w
  23. ww=InnerWidth
  24. wh=InnerHeight
  25. xa=0:ya=0:ystop=0
  26. If close=1 Then xa=6:ya=4
  27. y=2-ya/2
  28. If patwidth>ww-6+xa Then bw=ww-6+xa:Else bw=patwidth
  29. If patheight>wh-4+ya Then bh=wh-4+ya:Else bh=patheight
  30. Repeat
  31.   x=3-xa/2
  32.   If patwidth>ww-6+xa Then bw=ww-6+xa:Else bw=patwidth
  33.   Repeat
  34.     BitMaptoWindow #PATTERN,w,0,0,x+WBorLeft,y+WBorTop,bw,bh
  35.     x+bw
  36.     If x+bw-1=>ww-3+xa/2 Then bw=ww-x-3+xa/2:BitMaptoWindow #PATTERN,w,0,0,x+WBorLeft,y+WBorTop,bw,bh:x=ww-3+xa/2
  37.   Until x=>ww-3+xa/2
  38.   y+bh
  39.   If y=>wh-3+ya/2 Then ystop=1
  40.   If y+bh=>wh-2+ya/2 Then bh=wh-y-2+ya/2
  41. Until ystop=1
  42. If close=0 AND bor=1 GadgetBorder WBorLeft+6,WBorTop+3,ww-8-WBorRight,wh-4-WBorBottom
  43. If close=1 AND bor=1 GadgetBorder WBorLeft+4,WBorTop+2,ww-4-WBorRight,wh-2-WBorBottom
  44. End Statement
  45.  
  46.  
  47. ; Let's try it!
  48. Window 0,20,10,300,150,0,"EXAMPLE WINDOW",-1,-1
  49. Putpattern {w,0,1}
  50.  
  51. MouseWait
  52. End
  53.